<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActiveRecord::ConnectionAdapters::Table</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActiveRecord::ConnectionAdapters::Table 
            
                <span class="parent">&lt; 
                    
                    <a href="../../Object.html">Object</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../files/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions_rb.html">activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  
    <div class="description">
      
<p>Represents an SQL table in an abstract way for updating a table. Also see
<a href="TableDefinition.html">TableDefinition</a> and <a
href="SchemaStatements.html#method-i-create_table">ActiveRecord::ConnectionAdapters::SchemaStatements#create_table</a></p>

<p>Available transformations are:</p>

<pre class="ruby"><span class="ruby-identifier">change_table</span> :<span class="ruby-identifier">table</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">column</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">index</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">rename_index</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">timestamps</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">change</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">change_default</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">rename</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">references</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">belongs_to</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">string</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">text</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">integer</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">float</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">decimal</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">datetime</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">timestamp</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">time</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">date</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">binary</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">boolean</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">remove</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">remove_references</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">remove_belongs_to</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">remove_index</span>
  <span class="ruby-identifier">t</span>.<span class="ruby-identifier">remove_timestamps</span>
<span class="ruby-keyword">end</span>
</pre>

    </div>
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>B</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Table.html#method-i-belongs_to">belongs_to</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>C</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Table.html#method-i-change">change</a>,
              </li>
            
              
              <li>
                <a href="Table.html#method-i-change_default">change_default</a>,
              </li>
            
              
              <li>
                <a href="Table.html#method-i-column">column</a>,
              </li>
            
              
              <li>
                <a href="Table.html#method-i-column_exists-3F">column_exists?</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>I</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Table.html#method-i-index">index</a>,
              </li>
            
              
              <li>
                <a href="Table.html#method-i-index_exists-3F">index_exists?</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Table.html#method-c-new">new</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>R</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Table.html#method-i-references">references</a>,
              </li>
            
              
              <li>
                <a href="Table.html#method-i-remove">remove</a>,
              </li>
            
              
              <li>
                <a href="Table.html#method-i-remove_belongs_to">remove_belongs_to</a>,
              </li>
            
              
              <li>
                <a href="Table.html#method-i-remove_index">remove_index</a>,
              </li>
            
              
              <li>
                <a href="Table.html#method-i-remove_references">remove_references</a>,
              </li>
            
              
              <li>
                <a href="Table.html#method-i-remove_timestamps">remove_timestamps</a>,
              </li>
            
              
              <li>
                <a href="Table.html#method-i-rename">rename</a>,
              </li>
            
              
              <li>
                <a href="Table.html#method-i-rename_index">rename_index</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>T</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Table.html#method-i-timestamps">timestamps</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    


    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-new">
            
              <b>new</b>(table_name, base)
            
            <a href="Table.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L349" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 349</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">base</span>)
  <span class="ruby-ivar">@table_name</span> = <span class="ruby-identifier">table_name</span>
  <span class="ruby-ivar">@base</span> = <span class="ruby-identifier">base</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-belongs_to">
            
              <b>belongs_to</b>(*args)
            
            <a href="Table.html#method-i-belongs_to" name="method-i-belongs_to" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-change">
            
              <b>change</b>(column_name, type, options = {})
            
            <a href="Table.html#method-i-change" name="method-i-change" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Changes the column’s definition according to the new options. See <a
href="TableDefinition.html#method-i-column">ActiveRecord::ConnectionAdapters::TableDefinition#column</a>
for details of the options you can use.</p>

<pre>t.change(:name, :string, limit: 80)
t.change(:description, :text)</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-change_source')" id="l_method-i-change_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L405" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-change_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 405</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">change</span>(<span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">change_column</span>(<span class="ruby-ivar">@table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-change_default">
            
              <b>change_default</b>(column_name, default)
            
            <a href="Table.html#method-i-change_default" name="method-i-change_default" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Sets a new default value for a column. See <a
href="SchemaStatements.html#method-i-change_column_default">ActiveRecord::ConnectionAdapters::SchemaStatements#change_column_default</a></p>

<pre>t.change_default(:qualification, 'new')
t.change_default(:authorized, 1)</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-change_default_source')" id="l_method-i-change_default_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L413" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-change_default_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 413</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">change_default</span>(<span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">default</span>)
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">change_column_default</span>(<span class="ruby-ivar">@table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">default</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-column">
            
              <b>column</b>(column_name, type, options = {})
            
            <a href="Table.html#method-i-column" name="method-i-column" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Adds a new column to the named table. See <a
href="TableDefinition.html#method-i-column">ActiveRecord::ConnectionAdapters::TableDefinition#column</a>
for details of the options you can use.</p>

<h6 id="method-i-column-label-Creating+a+simple+column">Creating a simple column</h6>

<pre>t.column(:name, :string)</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-column_source')" id="l_method-i-column_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L359" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-column_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 359</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">column</span>(<span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">add_column</span>(<span class="ruby-ivar">@table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-column_exists-3F">
            
              <b>column_exists?</b>(column_name, type = nil, options = {})
            
            <a href="Table.html#method-i-column_exists-3F" name="method-i-column_exists-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Checks to see if a column exists. See <a
href="SchemaStatements.html#method-i-column_exists-3F">ActiveRecord::ConnectionAdapters::SchemaStatements#column_exists?</a></p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-column_exists-3F_source')" id="l_method-i-column_exists-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L364" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-column_exists-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 364</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">column_exists?</span>(<span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">column_exists?</span>(<span class="ruby-ivar">@table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-index">
            
              <b>index</b>(column_name, options = {})
            
            <a href="Table.html#method-i-index" name="method-i-index" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Adds a new index to the table. <code>column_name</code> can be a single <a
href="../../Symbol.html">Symbol</a>, or an <a
href="../../Array.html">Array</a> of Symbols. See <a
href="SchemaStatements.html#method-i-add_index">ActiveRecord::ConnectionAdapters::SchemaStatements#add_index</a></p>

<h6 id="method-i-index-label-Creating+a+simple+index">Creating a simple index</h6>

<pre>t.index(:name)</pre>

<h6 id="method-i-index-label-Creating+a+unique+index">Creating a unique index</h6>

<pre>t.index([:branch_id, :party_id], unique: true)</pre>

<h6 id="method-i-index-label-Creating+a+named+index">Creating a named index</h6>

<pre>t.index([:branch_id, :party_id], unique: true, name: 'by_branch_party')</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-index_source')" id="l_method-i-index_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L377" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-index_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 377</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">index</span>(<span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">add_index</span>(<span class="ruby-ivar">@table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-index_exists-3F">
            
              <b>index_exists?</b>(column_name, options = {})
            
            <a href="Table.html#method-i-index_exists-3F" name="method-i-index_exists-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Checks to see if an index exists. See <a
href="SchemaStatements.html#method-i-index_exists-3F">ActiveRecord::ConnectionAdapters::SchemaStatements#index_exists?</a></p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-index_exists-3F_source')" id="l_method-i-index_exists-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L382" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-index_exists-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 382</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">index_exists?</span>(<span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">index_exists?</span>(<span class="ruby-ivar">@table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-references">
            
              <b>references</b>(*args)
            
            <a href="Table.html#method-i-references" name="method-i-references" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Adds a reference. Optionally adds a <code>type</code> column, if
<code>:polymorphic</code> option is provided. <code>references</code> and
<code>belongs_to</code> are acceptable.</p>

<pre>t.references(:user)
t.belongs_to(:supplier, polymorphic: true)</pre>
            </div>
          
          
          
            <div class="aka">
              Also aliased as: <a href="Table.html#method-i-belongs_to">belongs_to</a>
            </div>
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-references_source')" id="l_method-i-references_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L459" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-references_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 459</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">references</span>(*<span class="ruby-identifier">args</span>)
  <span class="ruby-identifier">options</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">extract_options!</span>
  <span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ref_name</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">add_reference</span>(<span class="ruby-ivar">@table_name</span>, <span class="ruby-identifier">ref_name</span>, <span class="ruby-identifier">options</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-remove">
            
              <b>remove</b>(*column_names)
            
            <a href="Table.html#method-i-remove" name="method-i-remove" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Removes the column(s) from the table definition.</p>

<pre>t.remove(:qualification)
t.remove(:qualification, :experience)</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-remove_source')" id="l_method-i-remove_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L421" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-remove_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 421</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">remove</span>(*<span class="ruby-identifier">column_names</span>)
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">remove_columns</span>(<span class="ruby-ivar">@table_name</span>, *<span class="ruby-identifier">column_names</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-remove_belongs_to">
            
              <b>remove_belongs_to</b>(*args)
            
            <a href="Table.html#method-i-remove_belongs_to" name="method-i-remove_belongs_to" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-remove_index">
            
              <b>remove_index</b>(options = {})
            
            <a href="Table.html#method-i-remove_index" name="method-i-remove_index" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Removes the given index from the table.</p>

<h6 id="method-i-remove_index-label-Remove+the+index_table_name_on_column+in+the+table_name+table">Remove the index_table_name_on_column in the table_name table</h6>

<pre>t.remove_index :column</pre>

<h6 id="method-i-remove_index-label-Remove+the+index+named+index_table_name_on_branch_id+in+the+table_name+table">Remove the index named index_table_name_on_branch_id in the table_name table</h6>

<pre>t.remove_index column: :branch_id</pre>

<h6 id="method-i-remove_index-label-Remove+the+index+named+index_table_name_on_branch_id_and_party_id+in+the+table_name+table">Remove the index named index_table_name_on_branch_id_and_party_id in the table_name table</h6>

<pre>t.remove_index column: [:branch_id, :party_id]</pre>

<h6 id="method-i-remove_index-label-Remove+the+index+named+by_branch_party+in+the+table_name+table">Remove the index named by_branch_party in the table_name table</h6>

<pre>t.remove_index name: :by_branch_party</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-remove_index_source')" id="l_method-i-remove_index_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L435" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-remove_index_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 435</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">remove_index</span>(<span class="ruby-identifier">options</span> = {})
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">remove_index</span>(<span class="ruby-ivar">@table_name</span>, <span class="ruby-identifier">options</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-remove_references">
            
              <b>remove_references</b>(*args)
            
            <a href="Table.html#method-i-remove_references" name="method-i-remove_references" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Removes a reference. Optionally removes a <code>type</code> column.
<code>remove_references</code> and <code>remove_belongs_to</code> are
acceptable.</p>

<pre>t.remove_references(:user)
t.remove_belongs_to(:supplier, polymorphic: true)</pre>
            </div>
          
          
          
            <div class="aka">
              Also aliased as: <a href="Table.html#method-i-remove_belongs_to">remove_belongs_to</a>
            </div>
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-remove_references_source')" id="l_method-i-remove_references_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L473" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-remove_references_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 473</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">remove_references</span>(*<span class="ruby-identifier">args</span>)
  <span class="ruby-identifier">options</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">extract_options!</span>
  <span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ref_name</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">remove_reference</span>(<span class="ruby-ivar">@table_name</span>, <span class="ruby-identifier">ref_name</span>, <span class="ruby-identifier">options</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-remove_timestamps">
            
              <b>remove_timestamps</b>()
            
            <a href="Table.html#method-i-remove_timestamps" name="method-i-remove_timestamps" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Removes the timestamp columns (<code>created_at</code> and
<code>updated_at</code>) from the table.</p>

<pre>t.remove_timestamps</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-remove_timestamps_source')" id="l_method-i-remove_timestamps_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L442" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-remove_timestamps_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 442</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">remove_timestamps</span>
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">remove_timestamps</span>(<span class="ruby-ivar">@table_name</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-rename">
            
              <b>rename</b>(column_name, new_column_name)
            
            <a href="Table.html#method-i-rename" name="method-i-rename" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Renames a column.</p>

<pre>t.rename(:description, :name)</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-rename_source')" id="l_method-i-rename_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L449" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-rename_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 449</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">rename</span>(<span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">new_column_name</span>)
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">rename_column</span>(<span class="ruby-ivar">@table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">new_column_name</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-rename_index">
            
              <b>rename_index</b>(index_name, new_index_name)
            
            <a href="Table.html#method-i-rename_index" name="method-i-rename_index" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Renames the given index on the table.</p>

<pre>t.rename_index(:user_id, :account_id)</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-rename_index_source')" id="l_method-i-rename_index_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L389" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-rename_index_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 389</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">rename_index</span>(<span class="ruby-identifier">index_name</span>, <span class="ruby-identifier">new_index_name</span>)
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">rename_index</span>(<span class="ruby-ivar">@table_name</span>, <span class="ruby-identifier">index_name</span>, <span class="ruby-identifier">new_index_name</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-timestamps">
            
              <b>timestamps</b>()
            
            <a href="Table.html#method-i-timestamps" name="method-i-timestamps" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Adds timestamps (<code>created_at</code> and <code>updated_at</code>)
columns to the table. See <a
href="SchemaStatements.html#method-i-add_timestamps">ActiveRecord::ConnectionAdapters::SchemaStatements#add_timestamps</a></p>

<pre>t.timestamps</pre>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-timestamps_source')" id="l_method-i-timestamps_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/4e09301b0ce6f24bbc3980725d87774792867d01/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L396" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-timestamps_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 396</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">timestamps</span>
  <span class="ruby-ivar">@base</span>.<span class="ruby-identifier">add_timestamps</span>(<span class="ruby-ivar">@table_name</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    